import 'package:flutter/material.dart';
import 'constant.dart';

class LoadingPage extends StatefulWidget{

  @override
  State<StatefulWidget> createState() {

    return LoadingPageState();
  }
}

class LoadingPageState extends State<LoadingPage>{

  @override
  void initState() {

    super.initState();

    //延迟
    Future.delayed(Duration(seconds: 3),(){

      Navigator.of(context).pushReplacementNamed(routesHomePage);
    });
  }

  @override
  Widget build(BuildContext context) {

    return Center(

      child: Stack(

        children: <Widget>[

          //相当于 scaleType
          Image.asset(loadingImage,fit: BoxFit.cover,)

        ],
      ),
    );
  }
}

